package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;

import static org.jsola.hr.example.CustomTemplateFieldExample.*;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_COMPANY_ID;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_FIELD_CODE;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_FIELD_NAME;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_FIELD_TYPE;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_IS_DEFAULT;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_IS_EDIT;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_IS_NECESSARY;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_IS_OPEN;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_IS_REQUIRED;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_MODULE_CODE;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_MODULE_NAME;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_SORT;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_TEMPLATE_ID;
import static org.jsola.hr.example.CustomTemplateFieldExample.E_TYPE;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_FIELD_CODE_MAX;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_FIELD_NAME_MAX;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_MODULE_CODE_MAX;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_MODULE_CODE_NOT_NULL;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_MODULE_NAME_MAX;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_MODULE_NAME_NOT_NULL;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_TEMPLATE_ID_MAX;
import static org.jsola.hr.example.CustomTemplateFieldExample.M_TEMPLATE_ID_NOT_NULL;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_COMPANY_ID;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_FIELD_CODE;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_FIELD_NAME;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_FIELD_TYPE;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_IS_DEFAULT;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_IS_EDIT;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_IS_NECESSARY;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_IS_OPEN;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_IS_REQUIRED;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_MODULE_CODE;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_MODULE_NAME;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_SORT;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_TEMPLATE_ID;
import static org.jsola.hr.example.CustomTemplateFieldExample.N_TYPE;

/**
 * 自定义模板字段
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【自定义模板字段】的参数")
@Data
public class CustomTemplateFieldAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_SORT, example = E_SORT)
    private Integer sort;

    @ApiModelProperty(notes = N_IS_DEFAULT, example = E_IS_DEFAULT)
    private Boolean isDefault;

    @ApiModelProperty(notes = N_IS_EDIT, example = E_IS_EDIT)
    private Integer isEdit;

    @ApiModelProperty(notes = N_FIELD_TYPE, example = E_FIELD_TYPE)
    private Integer fieldType;

    @ApiModelProperty(notes = N_FIELD_CODE, example = E_FIELD_CODE)
    @Length(max = 32, message = M_FIELD_CODE_MAX)
    private String fieldCode;

    @ApiModelProperty(notes = N_FIELD_NAME, example = E_FIELD_NAME)
    @Length(max = 32, message = M_FIELD_NAME_MAX)
    private String fieldName;

    @ApiModelProperty(notes = N_IS_REQUIRED, example = E_IS_REQUIRED)
    private Boolean isRequired;

    @ApiModelProperty(notes = N_IS_NECESSARY, example = E_IS_NECESSARY)
    private Boolean isNecessary;

    @ApiModelProperty(notes = N_IS_OPEN, example = E_IS_OPEN)
    private Boolean isOpen;

    @ApiModelProperty(notes = N_MODULE_NAME, example = E_MODULE_NAME, required = true)
    @Length(max = 50, message = M_MODULE_NAME_MAX)
    private String moduleName;

    @ApiModelProperty(notes = N_MODULE_CODE, example = E_MODULE_CODE, required = true)
    @NotNull(message = M_MODULE_CODE_NOT_NULL)
    @Length(max = 30, message = M_MODULE_CODE_MAX)
    private String moduleCode;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_TEMPLATE_ID, example = E_TEMPLATE_ID, required = true)
    @NotNull(message = M_TEMPLATE_ID_NOT_NULL)
    @Length(max = 32, message = M_TEMPLATE_ID_MAX)
    private String templateId;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE)
    private Integer type;


}

